package com.yudaob2b.elong.enums.ela;

import java.util.Map;

/**
 * @Author: Kidd.Tan
 * @Description
 * @Date: Create in 16:40 2018/7/26
 */
public enum EnumElasticElongIndexName {

    INVENTORY("elong-inventory", "elong-inventory", Map.class),
    RATE("elong-rate", "elong-rate", Map.class),
    RP("elong-rp", "elong-rp", Map.class)
    ;

    private String indexName;

    private String type;

    private Class<?> object;

    private EnumElasticElongIndexName(String indexName, String type, Class<?> object) {
        this.indexName = indexName;
        this.type = indexName;
        this.object = object;
    }

    public String getIndexName() {
        return indexName;
    }

    public void setIndexName(String indexName) {
        this.indexName = indexName;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Class<?> getObject() {
        return object;
    }

    public void setObject(Class<?> object) {
        this.object = object;
    }

    public static EnumElasticElongIndexName getByIndexName(String indexName) {
        for (EnumElasticElongIndexName elasticApiIndexNameEnum : EnumElasticElongIndexName.values()) {
            if (elasticApiIndexNameEnum.getIndexName().equals(indexName)) {
                return elasticApiIndexNameEnum;
            }
        }
        return null;
    }
}
